package com.yifeng.repo.micro.service.server.mps;

import feign.Param;
import feign.RequestLine;
import next.fire.mps.api.MaterialService;
import next.fire.mps.api.model.Material;
import next.fire.mps.api.model.MaterialPackage;
import next.fire.mps.api.model.MaterialTypeEnum;
import next.framework.page.PageResult;
import org.springframework.cloud.openfeign.FeignClient;

@FeignClient(name = "mpsMaterialServiceClient", url = "${yfcloud.micro.service.mps.url}", path = "/fire-mps")
public interface MaterialServiceClient extends MaterialService {

    @Override
    @RequestLine("POST /MaterialService/uploadImage")
    String uploadImage(@Param("merchantId") String merchantId, @Param("mpAppId")String mpAppId, @Param("type")String type, @Param("name") String name, @Param("body") String body);

    @Override
    @RequestLine("POST /MaterialService/getImage")
    String getImage(@Param("merchantId")String merchantId, @Param("mpAppId") String mpAppId, @Param("materialId") String materialId);

    @Override
    @RequestLine("POST /MaterialService/list")
    PageResult<Material> list(@Param("merchantId")String merchantId, @Param("mpAppId")String mpAppId, @Param("materialType") MaterialTypeEnum materialType,
                              @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    @Override
    @RequestLine("POST /MaterialService/listPackage")
    PageResult<MaterialPackage> listPackage(@Param("merchantId") String merchantId, @Param("mpAppId")String mpAppId, @Param("pageNo")Integer pageNo, @Param("pageSize")Integer pageSize);

    @Override
    @RequestLine("POST /MaterialService/uploadAttachment")
    String uploadAttachment(@Param("merchantId")String merchantId, @Param("mpAppId")String mpAppId, @Param("mediaType")String mediaType, @Param("name") String name,
                            @Param("body") String body, @Param("attachmentType") String attachmentType);
}
